window: Set parent context instead of just resetting style
authorBenjamin Otte <otte@redhat.com>
Tue, 20 Mar 2012 17:08:08 +0000 (18:08 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 17 Apr 2012 06:59:10 +0000 (08:59 +0200)
Otherwise the inherit properties won't inherit properly.

gtk/gtkwindow.c

index 76f904959b890b8989bba28af6819b5e9925d3cc..b87c22e5f585bcb8b7c483acefd50f14409e54f5 100644 (file)
@@ -2642,6 +2642,7 @@ void
 gtk_window_set_attached_to (GtkWindow *window,
                             GtkWidget *attach_widget)
 {
+  GtkStyleContext *context;
   GtkWindowPrivate *priv;
 
   g_return_if_fail (GTK_IS_WINDOW (window));
@@ -2664,7 +2665,11 @@ gtk_window_set_attached_to (GtkWindow *window,
     }
 
   /* Update the style, as the widget path might change. */
-  gtk_widget_reset_style (GTK_WIDGET (window)); 
+  context = gtk_widget_get_style_context (GTK_WIDGET (window));
+  if (priv->attach_widget)
+    gtk_style_context_set_parent (context, gtk_widget_get_style_context (priv->attach_widget));
+  else
+    gtk_style_context_set_parent (context, NULL);
 }
 
 /**